// 引入axios
import axios from 'axios'

// export default function httpRequest(){

// }
//函数表达式
let httpRequest = function (method, url, params, data) {
    return axios({
        url,
        method,
        baseURL: "/api",
        headers: { "content-type": "application/json;charset=utf-8" },
        params,
        data,
        timeout: 10000
    }).then(response => {
        return response.data //获取响应结果的数据
    })
}
//默认导出
export default httpRequest;
